from functools import lru_cache

m = int(input())


@lru_cache(maxsize=None)
def get_color(level: int, number: int):
    if level == 0: return True
    if number & 1:
        return not get_color(level - 1, number >> 1)
    else:
        return get_color(level - 1, number >> 1)


for _ in range(m):
    n, k = map(int, input().split())
    print("RED" if get_color(n - 1, k - 1) else "BLACK")
